package com.mz.ozy.mvp.presenter;

import android.content.Context;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.DynamicListBean;
import com.mz.ozy.bean.HomePageBean;
import com.mz.ozy.bean.ReciprocityBean;
import com.mz.ozy.mvp.model.ExpertModel;
import com.mz.ozy.mvp.model.FindDynamicsModel;
import com.mz.ozy.mvp.model.FollowModel;
import com.mz.ozy.mvp.model.ReciprocityModel;
import com.mz.ozy.mvp.view.ExpertDetailContract;
import com.mz.ozy.mvp.view.ReciprocityContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import org.json.JSONObject;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class ReciprocityPresenter extends BasePresenterImpl<ReciprocityContract.View> implements ReciprocityContract.Presenter {

    private ReciprocityModel mExpertModel;

    public ReciprocityPresenter() {
        mExpertModel = new ReciprocityModel();
    }

    @Override
    public void queryExpertDetail(Context context, int pageNo) {
        mExpertModel.queryExpertDetail(context, pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<ReciprocityBean>(mView) {

                    @Override
                    public void onSuccesss(ReciprocityBean jsonObject) {
                        mView.getExpertDetail(jsonObject);
                    }
                });
    }
}
